﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BusinessObjects.BusinessRules;

namespace BusinessObjects.Production
{
    public class InventoryItem : BusinessObject
    {
        public InventoryItem()
        {
            AddRule(new ValidateRequired("InventoryCategoryID"));

            AddRule(new ValidateRequired("InventoryItemCode"));
            AddRule(new ValidateLength("InventoryItemCode", 0, 50));

            AddRule(new ValidateRequired("InventoryItemName"));
            AddRule(new ValidateLength("InventoryItemName", 0, 255));

            AddRule(new ValidateRequired("StockID"));
        }

        public InventoryItem(string inventoryItemId, string inventoryCategoryId, string inventoryItemCode, string inventoryItemName, string unitId,
                                decimal unitPrice, decimal salesPrice, string stockId, int minimumStock, bool isActive, string description, string restaurantId, bool isMaterial)
            : this()
        {
            InventoryItemID = inventoryItemId;
            InventoryCategoryID = inventoryCategoryId;
            InventoryItemCode = inventoryItemCode;
            InventoryItemName = inventoryItemName;
            UnitID = unitId;
            UnitPrice = unitPrice;
            SalesPrice = salesPrice;
            StockID = stockId;
            MinimumStock = minimumStock;
            Description = description;
            IsActive = isActive;
            RestaurantId = restaurantId;
            IsMaterial = isMaterial;
        }

        public string InventoryItemID { get; set; }

        public string InventoryCategoryID { get; set; }

        public string InventoryItemCode { get; set; }

        public string InventoryItemName { get; set; }

        public string UnitID { get; set; }

        public decimal UnitPrice { get; set; }

        public decimal SalesPrice { get; set; }

        public string StockID { get; set; }

        public int MinimumStock { get; set; }

        public string Description { get; set; }

        public bool IsActive { get; set; }

        public string RestaurantId { get; set; }

        public bool IsMaterial { get; set; }
    }
}
